package com.s3.khospitalds.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.s3.khospitalds.entity.TableShift;
import com.s3.khospitalds.service.TableShiftService;
import com.s3.khospitalds.service.impl.TableShiftServiceImpl;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/2/20
 * @Description: 护士轮班类
 * @Version: 1.0
 */
@Mapper
@Repository
public interface TableShiftMapper extends BaseMapper<TableShift> {
    @Insert("INSERT INTO table_shift (`time`, `date`, `name`, sex, department, shiftId, attendence, signature) VALUES\n" +
            "(#{time},#{date} , #{name} , #{sex} , #{department} , #{shiftId} , #{attendence} , #{signature})")
    public int insert(TableShift tableShift);

    @Update("UPDATE table_shift SET `time`= #{time} ,`date`= #{date} ,`name`= #{name} ,sex=#{sex}  ,department= #{department}  ,shiftId= #{shiftId} ,attendence=#{attendence}  ,signature =#{signature}   WHERE id=#{id} ")
    public int update(TableShift tableShift);

    @Delete("DELETE FROM `table_shift` WHERE id=#{id}")
    public int delete(int id);
}
